let ListNode = function(){
    this.head = null
    this.vav = null
    this.length = 0
    let slow = head ,fast = head.next
}

let Node = function(){
    this.vav = val
    this.next = null
}

//判断列表是否为环形链表
var udge = function(head) {
    //设置一个快指针，一个慢指针，并且都初始化为head
    let fast = head;
    let slow = head;
    while (fast!= null && fast.next != null) {
        slow = slow.next;//慢指针一次走一步
        fast = fast.next.next;//快指针一次走两步
        if(fast === slow) {
            return true;//快慢指针相遇时，说明是环形链表
        }
    }
    return false;
}

//增
function add (val) {
    let news = new Node(val);
    var cur = this.Last();
    news.next = cur.next;
    cur.next = news;
}

//删
let remove = function(val)  {
    let cur = new ListNode(0, head);
    if (cur.val === item) {
        cur.next = cur.next.next;
    }
    if (cur.next === this.head) {   
        return null;
    }
}

//改
let change = function(val,news) {
    let cur = this.find(val);
    if (node.val = val) {
        node.val = news;
    }
    else {
        console.log("该元素不存在！");
    }
}

//查
let find = function(val) {
    let cur = this.head;
    while (cur && cur.val) {
        if (cur.val == val) {
            console.log(cur)
        }
        cur = cur.next 
      }
      console.log(null)
}